<?php
$matkul=array("MES 251","MPK 101","MPK 102");
$isi[0]=array("3332060860","3332060861","3332060862","3332060867","3332060864");
$isi[1]=array("3332060861","3332060865","3332060874","3332060867","3332060868");
$isi[2]=array("3332060855","3332060865","3332060870","3332060871","3332060874");

$hitung1= count ($matkul);
for($a=0;$a<$hitung1;$a++){
$hitung2[$a]=count($isi[$a]);
}



for($a=0;$a<$hitung1;$a++){
$b=$a+1;
	for(;$b<$hitung1;$b++){
	$sama=0;
	for($aa=0;$aa<$hitung2[$a];$aa++){
		for($bb=0;$bb<$hitung2[$b];$bb++){
			if($isi[$a][$aa] == $isi[$b][$bb]){
			$sama++;
			}
		}
	}
	if ($sama<1){$hasil1=0;}
	else {$hasil1=1;}
	$hasil2[$a][$b]=$hasil1;
	echo $hasil2[$a][$b];echo "<br/>";
	}
}

echo "\n<table border='1'>\n<tr><td></td>";
for ($a=0;$a<$hitung1;$a++){
echo "<td>".$matkul[($a)]."</td>";
}
echo "</tr>\n";
for($a=0;$a<$hitung1;$a++){
echo "<tr><td>".$matkul[$a]."</td>";
	for($b=0;$b<$hitung1;$b++){
	echo "<td>".$hasil2[$a][$b]."</td>";
	}
echo "</tr>\n";
}
echo "</table>";

function cek_bentrok()
{

}
?>